/**
 * Copyright (c) 2003-2017 Ben Lau
 * All rights reserved.
 */
package chapter7;

/**
 * @author liubin
 *
 */
class SuperClass {
	static {
		System.out.println("SuperClass init!");
	}
	public static int value = 123;
}

class SubClass extends SuperClass {
	static {
		System.out.println("SubClass init!");
	}
}

public class Code7_1 {

	public static void main(String[] args) {
		//通过子类来引用父类的静态字段，只会触发父类的初始化，而不会触发子类的初始化
		System.out.println(SubClass.value);
	}

}
